from langchain_openai import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
from dotenv import load_dotenv

load_dotenv()

llm = ChatOpenAI(temperature=1.0, model="/file/ljw22/Qwen2.5-7B-Instruct")

# resp = llm.invoke("你好，我叫刘嘉伟").content
# print(resp)

template = ChatPromptTemplate([
    ("system", "You are a helpful AI bot. Your name is {name}."),
    ("human", "Hello, how are you doing?"),
    ("ai", "I'm doing well, thanks!"),
    ("human", "{user_input}"),
])

prompt_value = template.invoke(
    {
        "name": "Bob",
        "user_input": "What is your name?"
    }
)

resp = llm.invoke(prompt_value)
print(resp)
# print(prompt_value)